function loadArena() {
  $('.append').remove()
  $('#mainContent').append(template('t_arena', data))
  exit()
  request.getArenaMyInfo(function(res) {
    var info = res.info
    $('.myRank').html(info[0] + 1)
    if (res.arenaTimes > 0) {
      $('.need').html('每天免费挑战次数 ' + res.arenaTimes)
    } else {
      $('.need').html('每次挑战消耗 竞技令牌X1')
    }

    $('.record').empty()
    for (var i = info[1].length - 1; i >= 0; i--) {
      var result = info[1][i].result
      if (result === 1) {
        result = '胜'
      } else {
        result = '负'
      }
      var con = '<div class="line"><span class="p1name">' + info[1][i].p1 + '</span><span class="result">' + result + '</span><span class="p2name">' + info[1][i].p2 + '</span></div>'
        //var con = info[1][i].p1 + '&nbsp;&nbsp;' + result + '&nbsp;&nbsp;' + info[1][i].p2 + '<br>'
        //con += '<button class="playBattle" value="' + i + '">查看</button><br>'
      $('.record').append(con)
    }
  })
  request.getArenaInfo(function(res) {
    var info = res.info
    var html = ''
    for (var i = 0; i < info.length && i < 5; i++) {
      var rank = info[i][0]
      var name = info[i][1]
      if (name === player.name) {
        html += '<div class="link"><span class="rank">' + (rank + 1) + '</span><span class="pname">' + name + '</span></div>'
      } else {
        html += '<div class="link"><span class="rank">' + (rank + 1) + '</span><span class="pname">' + name + '</span><button class="chanllege" value="' + rank + '">挑战</button></div>'
      }
    }
    $('#arena .middle').html(html)

    $('.chanllege').click(function() {

      var value = $(this).attr('value')
      request.arenaChallenge(value, function(res) {
        if (res.error === 1) {
          showMessage('竞技令牌不足')
          return
        }
        loadArena()
        attacks(res.fightMsg)
      })
    })
  })
}
